class Animal(object):

    def speak(self):
        print("动物叫")


class Dog(Animal):

    def speak(self):
        print("汪汪汪")


class Cat(Animal):

    def speak(self):
        print("喵喵喵")


def speak(animal):
    animal.speak()

animal = Animal()
cat = Cat()
dog = Dog()
speak(animal)
speak(cat)
speak(dog)
